Image processing device and method of image processing

ABSTRACT

A control unit shifts an imaging unit relatively with respect to a stage to take an image of a measuring object at a plurality of places by the imaging unit and thereby obtain a plurality of images, and generates a composite image of the measuring object having a range which is wider than an imaging range of the imaging unit by combining the plurality of images. The control unit shifts the imaging unit relatively with respect to the stage such that parts of images adjacent to one another obtained by the imaging unit overlap, and performs an image matching processing that performs image matching of an overlapped portion of the adjacent images. The control unit generates the composite image of the measuring object by joining the adjacent images at a position where the image matching is performed in the image matching processing.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is based upon and claims the benefit of priority fromthe prior Japanese Patent Application No. 2012-34779, filed on Feb. 21,2012, the entire contents of which are incorporated herein by reference.

BACKGROUND OF THE INVENTION

1. Field of the Invention

This invention relates to an image processing device employed in thelikes of a hardness testing device and a method of image processing.

2. Description of the Related Art

A hardness testing device that measures hardness of a measuring objectbased on a shape of an indentation formed in a surface of the measuringobject, is known (refer to JP 2010-190817 A and JP 2005-345117 A). Inthis hardness testing device, the measuring object is disposed on astage and a measured value of hardness of the measuring object isobtained using an image of the measuring object capable of being takenby an imaging device. When the image shows only a region of part of themeasuring object, an entire image showing the measuring object isnecessary. Thus, conventionally, a method that shifts the stagerelatively in a certain direction to take a plurality of images andjoins these plurality of images to generate a composite image, is known(refer to JP H08-313217 A).

However, in the above-described method for generating a composite image,if directions of coordinate axes of the image and directions ofcoordinate axes of the stage are not in parallel, then in a portionwhere the image is joined, the composite image becomes discontinuous anderrors are generated in coordinate values of the image in a coordinatesystem of the stage. This problem is solved if an attitude of theimaging device is physically adjusted such that directions of thecoordinate axes of the image and the coordinate axes of the stage arematched. However, that adjustment is laborious and adjustment costs arealso required.

The present invention was made in view of such a problem and has anobject of providing an image processing device and a method of imageprocessing capable of generating a composite image having nodiscontinuity at a composite portion, easily and at low cost.

SUMMARY OF THE INVENTION

An image processing device according to the present invention comprises:an imaging unit for taking an image of a measuring object; a stageconfigured to be mountable with the measuring object and to be shiftablerelatively with respect to the imaging unit; and a control unit forshifting the imaging unit relatively with respect to the stage to takean image of the measuring object at a plurality of places by the imagingunit and thereby obtain a plurality of images, and for generating acomposite image of the measuring object having a range which is widerthan an imaging range of the imaging unit by combining the obtainedplurality of images or images obtained by a certain processing from theobtained plurality of images, the control unit shifting the imaging unitrelatively with respect to the stage such that parts of images adjacentto one another obtained by the imaging unit overlap, the control unitperforming an image matching processing that performs image matching ofan overlapped portion of the adjacent images, and the control unitgenerating the composite image of the measuring object by joining theadjacent images at a position where the image matching is performed inthe image matching processing.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a schematic view showing a hardness testing device accordingto a first embodiment.

FIG. 2 is a block diagram showing a computer main body 21 according tothe first embodiment.

FIG. 3 is a schematic view showing misalignment of a coordinate systemof an imaging unit 12 and a coordinate system of a stage 13.

FIG. 4 is a flowchart showing operation of the hardness testing deviceaccording to the first embodiment.

FIG. 5 is a schematic view showing shifting of the stage 13, imaging ofa workpiece W, and image matching processing in steps S101, S102, andS104 according to the first embodiment.

FIG. 6 is a schematic view showing the image matching processing in S104according to the first embodiment.

FIG. 7 is a schematic view showing the image matching processing in S104according to the first embodiment.

FIG. 8 is a schematic view showing the image matching processing in S104according to the first embodiment.

FIG. 9 is a schematic view showing calculation of a stage shiftingamount in step S105 according to the first embodiment.

FIG. 10 is a schematic view showing a hardness testing machine 30according to a second embodiment.

FIG. 11 is a schematic view showing shifting of the stage 13 along anedge E of the workpiece W, and imaging of the workpiece W according to athird embodiment.

FIG. 12 is a flowchart showing an edge tracking processing according tothe third embodiment.

FIG. 13 is a view showing a display screen according to the thirdembodiment.

FIG. 14 is a view showing edge point detection in a window according tothe third embodiment.

FIG. 15 is a view showing a determining sequence of window positionsaccording to the third embodiment.

DETAILED DESCRIPTION OF THE EMBODIMENTS

Next, embodiments of the present invention are described in detail withreference to the drawings.

First Embodiment

FIG. 1 is a schematic view showing a hardness testing device accordingto the present embodiment. As shown in FIG. 1, the hardness testingdevice includes a hardness testing machine 10 and a computer system 20for controlling the hardness testing machine 10. Note that in thepresent embodiment, the hardness testing device functions also as animage processing device for generating a composite image.

The hardness testing machine 10 includes a support 11, an imaging unit12, a stage 13 and a turret 14. The support 11 has a C shape when viewedfrom an X direction (perpendicular direction to paper plane in FIG. 1).The imaging unit 12 is provided on an upper portion of the support 11and takes an image of a workpiece W (measuring object) via a cameramount 15. The imaging unit 12 is configured by, for example, a CCDcamera or a CMOS camera.

The stage 13 is provided on a lower side of the support 11 via ashifting mechanism 16. The shifting mechanism 16 is configured such thatthe stage 13 is shiftable in an X axis direction, a Y axis direction,and a Z axis direction that are orthogonal to one another. That is, theshifting mechanism 16 is configured such that the imaging unit 12 isshiftable relatively with respect to the stage 13. The shiftingmechanism 16 is controlled by the computer system 20 to drive the stage13.

The turret 14 is provided on an upper portion of the support 11. Theturret 14 is configured rotatable around a turret rotating shaftparallel to the Z axis, and includes on its lower side an indenter 17and objective lenses 18 a and 18 b. The indenter 17 is for being pressedonto the workpiece W to make an indentation in a surface of theworkpiece W. The objective lenses 18 a and 18 b are each for configuringan imaging optical system along with the imaging unit 12. Rotation ofthe turret 14 allows the indenter 17 and the objective lenses 18 a and18 b to be switchably disposed to a usage position.

The computer system 20 includes a computer main body 21, a display unit22 which is a liquid crystal panel or the like, a keyboard 23 and amouse 24. As shown in FIG. 2, the computer main body 21 includes, forexample, a CPU 211, a ROM 212, a RAM 213 and a HDD 214. The CPU 211executes processing according to a macro-program stored in the ROM 212and a program stored in the RAM 213 from the HDD 214. The CPU 211controls the imaging unit 12, the shifting mechanism 16 and the displayunit 22 according to the programs. In addition, the CPU 211 receivesinput information from the keyboard 23 and the mouse 24.

Next, a coordinate system of the hardness testing device according tothe present embodiment is described with reference to FIG. 3. As shownin FIG. 3, the present embodiment includes a coordinate system (x, y) ofthe imaging unit 12 and a coordinate system (X, Y) of the stage 13. Now,an axis x and an axis y are mutually orthogonal and are axes set in animage obtained by the imaging unit 12. An axis X and an axis Y aremutually orthogonal and are directions in which the stage 13 isshiftable. Note that the axis x and the axis y may also be axes set inan image obtained by the imaging unit 12 and that has undergone acertain processing.

As shown in FIG. 3, the coordinate system (X, Y) of the stage 13 has anangle e with the coordinate system (x, y) of the imaging unit 12. Now,for example, an image is taken of the workpiece W while shifting thestage 13 by an amount of a certain distance in an X axis direction toobtain a plurality of images, and those plurality of images, while beingdisplaced by an amount of a certain distance in an x axis direction, arejoined to generate a composite image. However, in this method, due tomisalignment by the angle θ, that composite image becomes adiscontinuous image different to the actual workpiece W. As a result,there is a problem that, when an indentation position is disposed onthis composite image and an indentation made in the workpiece W, itsometimes occurs that the position is misaligned, and hardness testingof a targeted place may not necessarily be performed.

Therefore, in the present embodiment, a composite image IMa is generatedusing a processing of the kind shown in FIG. 4. Note that control shownin FIG. 4 is executed by the CPU 211. As shown in FIG. 4, first, thestage 13 is shifted in a certain direction (S101). Next, an image istaken of the workpiece W by the imaging unit 12 to obtain an imageIM(S102). In step S102, the image IM is displayed in the display unit22. Then, it is judged whether a certain number of images IM(1)-IM(n)have been taken or not (S103). Now, if it is judged that the imagesIM(1)-IM(n) have not been taken (S103, No), then processing is executedagain from step S101. On the other hand, if it is judged that the imagesIM(1)-IM(n) have been taken (S103, Yes), then the images IM(1)-IM(n) arejoined by an image matching processing mentioned later to generate thecomposite image IMa (S104). Now, the composite image IMa is an image ofthe workpiece W having a range which is wider than a one-shot imagingrange of the imaging unit 12. In step S104, the composite image IMa isdisplayed in the display unit 22. Note that the composite image IMa maybe configured capable of being printed by a printer. Then, shiftingamounts ΔX and ΔY of the stage 13 (stage shifting amounts) in the X axisand Y axis directions in which the stage 13 is shiftable are calculatedbased on the composite image IMa (S105). Note that, as mentioned later,shifting of the imaging unit 12 is controlled based on these stageshifting amounts.

Subsequent to step S105, an indentation position is set based on thecomposite image IMa (S106). For example, a shape of the workpiece W isrecognized from the composite image IMa, and the indentation position isdisposed automatically from the shape of that workpiece. Alternatively,by using the keyboard 23 and the mouse 24 to designate any position onthe composite image IMa displayed in the display unit 22, theindentation position is disposed manually in that designated position.

Next, the indenter 17 is pressed onto the surface of the workpiece W tomake an indentation in the disposed indentation position (S107). Then,an image is taken of this indentation, and a hardness value calculatedbased on a shape (size) of the indentation (S108). Then, thisindentation position (coordinate value on the composite image) and thehardness value corresponding to that position are displayed in thedisplay unit 22 (S109).

Next, shifting of the stage 13, imaging of the workpiece W and the imagematching processing in steps S101, S102 and S104 are describedspecifically with reference to FIG. 5. In an example shown in FIG. 5,first, an image of the image IM(1) is taken by the imaging unit 12.Next, the stage 13 is shifted in parallel in the −X axis direction by anamount of a range which is slightly smaller than a size of the one-shotimaging range of the imaging unit, 12 in the X axis direction to takeimages of the images IM(2) and IM(3). Next, the stage 13 is shifted inparallel in the +Y axis direction by an amount of a range which isslightly smaller than a size of the one-shot imaging range of theimaging unit 12 in the Y axis direction to take an image of the imageIM(4). Then, the stage 13 is shifted in parallel in the +X axisdirection by an amount of a range which is slightly smaller than a sizeof the one-shot imaging range of the imaging unit 12 in the X axisdirection to take images of the images IM(5) and IM(6). As a result,adjacent images IM(1)-IN(6) are taken so as to include overlappingregion images RIM(1)-RIM(7) that overlap one another to configure acomposite portion. Subsequently, image matching is performed to matchpatterns inside the overlapping region images RIM(1)-RIM(7) (imagematching processing). Then, the composite image IMa is generated byjoining the adjacent images IM(1)-IM(6) at a position where the imagematching is performed in the image matching processing. These compositeimage IMa, images IM(1)-IM(6), and overlapping region imagesRIM(1)-RIM(7) are displayed in the display unit 22.

Next, the image matching processing in the above-mentioned step S104 isdescribed specifically with reference to FIG. 6. FIG. 6 shows an examplewhere image matching is performed on the overlapping region imagesRIM(1) and RIM(2) of the images IM(1) and IM(2) to generate thecomposite image IMa. First, the overlapping region images RIM(1) andRIM(2) of the images IM(1) and IM(2) are extracted (S1041).

Then, the overlapping region images RIM(1) and RIM(2) each undergo imagecompression by a thinning processing or the like to generate compressedimages SRIM(1) and SRIM(2) (S1042). Reducing a data amount subject toarithmetic processing in the image matching processing by thisprocessing of step S1042 makes it possible to reduce time required inthe image matching processing that follows this processing of stepS1042.

Next, the fellow data-compressed compressed images SRIM(1) and SRIM(2)undergo image matching (macro-matching) to calculate a misalignmentamount between the images IM(1) and IM(2) (relative position between thecompressed images) (S1043). The two images IM(1) and IM(2) can be joinedbased on this misalignment amount to obtain the composite image IMa.When matching processing is to be performed even more accurately, it ispreferable to perform image matching (micro-matching) using thepre-compression overlapping region images RIM(1) and RIM(2) in theimages IM(1) and IM(2) with this misalignment amount as an initial value(S1044). This allows searching to be commenced from a vicinity of afinal matching position, hence enables the misalignment amount of thetwo images IM(1) and IM(2) to be more accurately obtained by a smallamount of processing, whereby a composite image IMa having nodiscontinuous portion can be generated based on this misalignmentamount.

Note that, in addition to the above-described processing, or in place ofthe image matching (S1042, S1043, S1044), a processing of the kind shownin FIG. 7, for example, may be performed. That is, the overlappingregion images RIM(1) and RIM(2) are each binarized into a region of highbrightness and a region of low brightness based on a certain thresholdvalue to generate binarized images BIM(1) and BIM(2). Next, the fellowbinarized images BIM(1) and BIM(2) undergo image matching(macro-matching) to calculate a misalignment amount between the imagesIM(1) and IM(2) (misalignment amount between the binarized images). Thetwo images IM(1) and IM(2) can be joined based on this misalignmentamount to obtain the composite image IMa. When matching processing is tobe performed even more accurately, it is preferable to then performimage matching (micro-matching) of a fine pattern in the region of highbrightness in the overlapping region images RIM(1) and RIM(2) with thismisalignment amount as an initial value, and thereby calculate a finalmisalignment amount between the images IM(1) and IM(2). Then, acomposite image IMa having no discontinuous portion can be generatedbased on this misalignment amount.

Moreover, in addition to the above-described processing, or in place ofthe image matching (S1042, S1043, S1044), a processing of the kind shownin FIG. 8, for example, may be performed. That is, edge images EIM(1)and EIM(2) are generated, the edge images EIM(1) and EIM(2) having anoutline (edge) only of an image extracted from each of the overlappingregion images RIM(1) and RIM(2). Next, the fellow edge images EIM(1) andEIM(2) undergo image matching (macro-matching) to calculate amisalignment amount between the images IM(1) and IM(2) (misalignmentamount between the edge images). The two images IM(1) and IM(2) can bejoined based on this misalignment amount to obtain the composite imageIMa. When matching processing is to be performed even more accurately,it is preferable to perform image matching (micro-matching) of theoverlapping region images RIM(1) and RIM(2) in the images IM(1) andIM(2) with this misalignment amount as an initial value. Even this kindof processing allows a composite image IMa having no discontinuousportion to be generated.

Next, calculation of the stage shifting amount in the above-mentionedstep S105 is described specifically with reference to FIG. 9. FIG. 9shows an example where the stage shifting amount in the X axis and Yaxis directions in which the stage 13 is shiftable is calculated basedon the misalignment amount between the image IM(1) and the image IM(2)in the composite image IMa. Now, a coordinate system (X′, Y′) is set inthe composite image IMa. An axis X′ and an axis Y′ in the coordinatesystem (X′, Y′) of the composite image are mutually orthogonal and areset parallel to the axis x and the axis y, respectively, in thecoordinate system (x, y) of the imaging unit 12. On the other hand, asmentioned above, the coordinate system (X, Y) of the stage 13 ismisaligned with the coordinate system (x, y) of the imaging unit 12 byan angle θ, hence the coordinate system (X′, Y′) of the composite imageIMa is also misaligned with the coordinate system (X, Y) of the stage 13by the angle θ.

In the example shown in FIG. 9, the misalignment amount of the imageIM(2) with respect to the image IM(1) in the composite image IMa whenthe stage 13 is shifted by an amount of ΔX in the X axis direction isassumed to be ΔX′, and the misalignment amount in the Y axis directionis assumed to be ΔY′. The stage shifting amounts ΔX and ΔY are obtainedwith respect to these ΔX′ and ΔY′ in view of the angle θ. In this case,since the angle θ is assumed to be an extremely small value (forexample, less than 6×10⁻⁴ rad), the angle θ may be obtained by anapproximation formula “(ΔY′/ΔX′)=tan θ≈θ”. Also, “sin θ≈θ” and “cosθ≈1”. It can be understood from these that the stage shifting amount ΔXin the X axis direction and the stage shifting amount ΔY in the Y axisdirection need only have original shifting amounts ΔX₀ and ΔY₀ increasedor decreased by amounts of ΔY₀·θ in the X axis direction and ΔX₀·θ inthe Y axis direction. These stage shifting amounts ΔX and ΔY allow thestage 13 to be shifted along a path designated by the coordinate system(X′, Y′) of the composite image.

As described above, the present embodiment makes it possible to generatea composite image IMa having no discontinuity at a composite portion,easily and at low cost, without adjusting the coordinate system of thestage 13 and the coordinate system of the imaging unit 12. The presentembodiment also makes it possible to shift the stage 13 accurately basedon the coordinate system of the composite image by calculating the stageshifting amount.

Second Embodiment

Next, a hardness testing device according to a second embodiment isdescribed with reference to FIG. 10. The hardness testing deviceaccording to the second embodiment includes a hardness testing machine30 different to that in the first embodiment. The second embodimentdiffers from the first embodiment in this point only, and is similar tothe first embodiment regarding other configurations and operation.

As shown in FIG. 10, the hardness testing machine 30 includes a base 31and a support 32 extending in a Z direction from the base 31. Providedon an upper surface of the base 31 is a stage 33 shiftable in an Xdirection and a Y direction. The stage 33 is configured such that itsupper surface is mountable with the workpiece W. Provided to a sidesurface of the support 32 is a unit 34 shiftable in the Z direction.

The unit 34 is provided with an imaging unit 35 and a turret 36. Theimaging unit 35 takes an image of the workpiece W mounted on the stage33. The turret 36 is provided at a lower end of the unit 34, isconfigured rotatable around a turret rotating shaft parallel to the Zaxis, and includes on its lower side an indenter 37 and objective lenses38 a and 38 b for configuring an image optical system along with theimaging unit 35. Similar advantages to those of the first embodiment aredisplayed, even with the above-described hardness testing machine 30according to the second embodiment.

Third Embodiment

Next, a hardness testing device according to a third embodiment isdescribed. The hardness testing device according to the third embodimentdiffers from that of the first embodiment in a method of shifting of thestage 13 only. Now, in the above-described first embodiment, an image ofa designated region of the workpiece W is taken. In contrast, in thethird embodiment, as shown in FIG. 11, an edge E of the workpiece W istracked based on an image taken beforehand (edge tracking processing),and an image is taken of images IM(1)-IM(4) along that edge E. Then, inthe third embodiment, the previously mentioned image matching isexecuted on those images IM(1)-IM(4) to generate the composite imageIMa.

Next, the edge tracking processing is described with reference to FIGS.12 and 13. FIG. 12 is a flowchart showing the edge tracking processing,and FIG. 13 is a view for explaining this processing and shows imageinformation 41 indicating a part of the workpiece W displayed in thedisplay unit 22. The image information 41 shown in FIG. 13 includes anedge 42 which is attempting to be tracked. Therefore, first, the mouse24 and so on are operated to set an initial position of a rectangularwindow 43 indicating a measuring region so as to include a part of theedge 42 inside the window 43 (FIG. 12, S201). For example, as shown inFIG. 13, the window 43 is designated by the likes of an operation thatsets four corners A, B, C, and D of the window 43 by click operation ofthe mouse 24, or an operation that, after designating two points atopposing corner directions of the rectangle, inclines that rectangularregion at any angle to shift the rectangular region by a drag operation.Note that, at this time, a direction for tracking along the edge 42 isalso designated.

When the initial position of the window 43 is set, next, a plurality ofedge points 44 are detected from multi-value image information in thewindow 43 (FIG. 12, S202). FIG. 14 shows details of this sampling. Aninterval of sampling of the edge points shown in FIG. 14 is setpreviously. First, as shown in FIG. 14, multi-value image information ofan address indicated by x and y coordinates is extracted, from a startpoint A(x_(a), y_(a)) to an end point B (x_(b), y_(b)), while changingan x coordinate cos θ at a time [where θ is an inclination of the window43] and a y coordinate sin θ at a time. An appropriate threshold levelis set from the obtained multi-value point sequence data, and samplingis performed, the sampling setting a point where this threshold leveland the point sequence data intersect as an edge point. Next, the startpoint and the end point are shifted by amounts of Δ·sin θ and θ·cos θ,respectively, and similar sampling is executed. When the aboveprocessing is performed successively to a start point C (x_(c), y_(c))and end point D (x_(d), y_(d)), sampling of the plurality of edge points44 at the previously set interval Δ is completed.

Next, an approximate line is fitted to sampling values of the obtainedplurality of edge points 44 by, for example, a method of least squares(FIG. 12, S203). Now, as shown in FIG. 15, if an approximate line L isassumed to be obtained from the sampling values of the edge points 44obtained by the window 43, then a next window 43′ is determined so as toconform with this approximate line L (FIG. 12, S204). Therefore, first,a perpendicular line is dropped to the approximate line L from an edgepoint 43a nearest to an edge in the shifting direction of the window 43obtained by the present window 43, then a point P₁ and a point P₂ areobtained, the point P₁ being separated from a crossing point of theperpendicular line and the approximate line L by an amount of H·m/100(where H is a height of the window and m is a previously set duplicationrate (%)) along the approximate line L in an opposite direction to theshifting direction of the window 43, and the point P₂ being separatedfrom the point P₁ by an amount of H in the shifting direction of thewindow 43. Next, points that are on lines orthogonal to the approximateline L at each of points P₁ and P₂ and that are each separated from theapproximate line L by an amount of W/2 (where W is a width of thewindow) are set as points A′, B′, C′, and D′ at four corners of a newwindow 43′. As a result, the next window 43′ is determined.

When the next window 43′ is determined, the window 43 is shiftedsequentially while performing sampling of edge points and fitting of anapproximate line in the window 43′ similarly to as previously mentioned.Then, when the edge to be tracked is all tracked, the processing iscompleted (FIG. 12, S205).

This concludes description of embodiments of the present invention, butit should be noted that the present invention is not limited to theabove-described embodiments, and that various alterations, additions,and so on, are possible within a range not departing from the scope andspirit of the invention. For example, disposition of the indentationposition may also be based on the likes of CAD data or shape data of aworkpiece of a profile measuring instrument.

In addition, shifting of the stages 13 and 33, and the unit 34 may alsobe performed manually. Moreover, when any position on the compositeimage IMa displayed in the display unit 22 is designated by an operatorby the keyboard 23 and the mouse 24, an image of that designatedposition may also be taken by the imaging unit 12.

What is claimed is:
 1. An image processing device, comprising: animaging unit for taking an image of a measuring object; a stageconfigured to be mountable with the measuring object and to be shiftablerelatively with respect to the imaging unit; and a control unit forshifting the imaging unit relatively with respect to the stage to takean image of the measuring object at a plurality of places by the imagingunit and thereby obtain a plurality of images, and for generating acomposite image of the measuring object having a range which is widerthan an imaging range of the imaging unit by combining the obtainedplurality of images or images obtained by a certain processing from theobtained plurality of images, the control unit shifting the imaging unitrelatively with respect to the stage such that parts of images adjacentto one another obtained by the imaging unit overlap, the control unitperforming an image matching processing that performs image matching ofan overlapping portion of the adjacent images, and the control unitgenerating the composite image of the measuring object by joining theadjacent images at a position where the image matching is performed inthe image matching processing.
 2. The image processing device accordingto claim 1, wherein the control unit calculates a misalignment amount ofcoordinates in the image and the stage by the image matching processing,and controls shifting of the imaging unit with respect to the stagebased on the misalignment amount.
 3. The image processing deviceaccording to claim 1, wherein the control unit performs imagecompression of the overlapping portion to generate a compressed image,and performs the image matching processing to the compressed image. 4.The image processing device according to claim 1, wherein the controlunit binarizes the overlapping portion to generate a binarized image,and performs the image matching processing to the binarized image. 5.The image processing device according to claim 1, wherein the controlunit extracts an outline of the overlapping portion to generate an edgeimage, and performs the image matching processing to the edge image. 6.The image processing device according to claim 1, wherein the controlunit performs image compression of the overlapping portion to generate acompressed image, performs image matching of fellow compressed images toobtain a relative position between the compressed images, and executesthe image matching processing with the relative position between thecompressed images as an initial value.
 7. The image processing deviceaccording to claim 1, wherein the control unit binarizes the overlappingportion to generate a binarized image, performs image matching of fellowbinarized images to obtain a relative position between the binarizedimages, and executes the image matching processing with the relativeposition between the binarized images as an initial value.
 8. The imageprocessing device according to claim 1, wherein the control unitextracts an outline of the overlapping portion to generate an edgeimage, performs image matching of fellow edge images to obtain arelative position between the edge images, and executes the imagematching processing with the relative position between the edge imagesas an initial value.
 9. The image processing device according to claim1, wherein the control unit sets a window in an image that includes anedge such that a part of the edge is included in the window, detects aplurality of edge points in the set window from image information in theset window, fits an approximate line to the detected plurality of edgepoints, and sets a next new window such that a partial region of the newwindow overlaps a current window along the fitted approximate line, andthe control unit, by repeating sequentially detection of the edgepoints, fitting of the approximate line, and generation of the newwindow based on the image information in the new window, extractsrequired measurement points in the window while shifting the windowalong the edge of the image.
 10. The image processing device accordingto claim 1, further comprising: an indenter for making an indentation inthe measuring object, wherein the control unit receives designation of aposition for making the indentation based on the composite image. 11.The image processing device according to claim 10, further comprising: aplurality of objective lenses for the imaging unit; and a turret fordisposing the indenter and the plurality of objective lenses at acertain position.
 12. An image processing device, comprising: an imagingunit for taking an image of a measuring object; a stage configured to bemountable with the measuring object and to be shiftable relatively withrespect to the imaging unit; and a control unit for shifting the imagingunit relatively with respect to the stage to take an image of themeasuring object at a plurality of places by the imaging unit andthereby obtain a plurality of images, the control unit shifting theimaging unit relatively with respect to the stage such that parts ofimages adjacent to one another obtained by the imaging unit overlap, thecontrol unit performing an image matching processing that per formsimage matching of an overlapping portion of the adjacent images, and thecontrol unit calculating a misalignment amount of coordinates in theimage and the stage by the image matching processing, and controllingshifting of the imaging unit with respect to the stage based on themisalignment amount.
 13. The image processing device according to claim12, wherein the control unit performs image compression of theoverlapping portion to generate a compressed image, and performs theimage matching processing to the compressed image.
 14. The imageprocessing device according to claim 12, wherein the control unitbinarizes the overlapping portion to generate a binarized image, andperforms the image matching processing to the binarized image.
 15. Theimage processing device according to claim 12, wherein the control unitextracts an outline of the overlapping portion to generate an edgeimage, and performs the image matching processing to the edge image. 16.A method of image processing, in which an imaging unit for taking animage of a measuring object and a stage configured to be mountable withthe measuring object and to be shiftable relatively with respect to theimaging unit are employed to shift the imaging unit relatively withrespect to the stage to take an image of the measuring object at aplurality of places by the imaging unit and thereby obtain a pluralityof images, and to generate a composite image of the measuring objecthaving a range which is wider than an imaging range of the imaging unitby combining the obtained plurality of images or images obtained by acertain processing from the obtained plurality of images, the methodcomprising: shifting the imaging unit relatively with respect to thestage such that parts of images adjacent to one another obtained by theimaging unit overlap; performing an image matching processing thatperforms image matching of an overlapping portion of the adjacentimages; and generating the composite image of the measuring object byjoining the adjacent images at a position where the image matching isperformed in the image matching processing.
 17. The method of imageprocessing according to claim 16, further comprising: calculating amisalignment amount of coordinates in the image and the stage by theimage matching processing, and controlling shifting of the imaging unitwith respect to the stage based on the misalignment amount.
 18. Themethod of image processing according to claim 16, further comprising:performing image compression of the overlapping portion to generate acompressed image, and performing the image matching processing to thecompressed image.
 19. The method of image processing according to claim16, further comprising: binarizing the overlapping portion to generate abinarized image, and performing the image matching processing to thebinarized image.
 20. The method of image processing according to claim16, further comprising: extracting an outline of the overlapping portionto generate an edge image, and performing the image matching processingto the edge image.